home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* */
- /* interfaces for a simple, MULTI-window graphics shell */
- /* */
- /* 6/96 bob Updated #includes to support changed GX Library names. */
- /* Updated the copyright date. */
- /* */
- /* ©1990 - 1996 Apple Computer, Inc. */
- /* All rights reserved. */
- /* */
- /****************************************************************************/
-
- #include <Desk.h>
- #include <Events.h>
- #include <Fonts.h>
- #include <Windows.h>
- #include <Memory.h>
- #include <ToolUtils.h>
- #include <Menus.h>
- #include <Resources.h>
- #include <Quickdraw.h>
- #include <GestaltEqu.h>
- #include <CodeFragments.h>
-
- #include <GXEnvironment.h>
- #include <GXGraphics.h>
- #include "GraphicsLibraries.h"
- #include <GXErrors.h>
- #include "FontLibrary.h"
- #include "QDLibrary.h"
- #include <GXPrinting.h>
- #include <LayoutEditLibrary.h>
-
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| EXTERN GLOBALS
- |**| ---------------------------------------------------------------------
- \**/
- // the following are expected to be initialized by the shell:
-
- // QuickDraw GX shell.c:
-
- extern Boolean gQuitting;
-
- // the following are expected to be initialized by your code:
-
- extern Rect gWindowQDRect;
- extern Str255 gWindowTitle;
- extern Boolean gDebugging;
- extern Boolean gGiveMeValidation;
- extern long gGraphicsHeapSize;
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| PROTOTYPES
- |**| ---------------------------------------------------------------------
- \**/
-
- // QuickDraw GX shell.c:
-
- void main (void);
- void InitToolbox (void);
- void CheckQuickDrawGX (void);
- OSErr MyPrintingEventOverride (EventRecord *event, Boolean filterEvent);
- void EventLoop (void);
- Boolean IsAppWindow (WindowPtr wind);
- void MyDoEvent (EventRecord *event);
- void DoMouseDown (EventRecord *event);
-
- // QDGX shell misc.c:
-
- void DoMenuCommand (long menuResult);
- gxJob GetDocJob (WindowPtr);
- gxShape GetDocShape (WindowPtr);
- LayoutEditHandle GetDocLEHandle (WindowPtr);
- short MyStrLength (char *s);
-
- // QDGX shell printing.c:
-
- void SetUpEditMenuRec (gxEditMenuRecord *);
- OSErr DoFormat (WindowPtr, gxDialogResult *);
- OSErr DoPrinting (WindowPtr);
- OSErr DoPrintOne (WindowPtr);
-
- // routines required by your code
- void DoSetup (void);
- void DoDraw (WindowPtr wind, Boolean updating);
- OSErr DoCreateNew (void);
- void DoDispose (WindowPtr wind);
- void DoIdle (WindowPtr wind);
- void DoTeardown (void);
- void DoClick (WindowPtr wind, Point p);
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| ENUMS
- |**| ---------------------------------------------------------------------
- \**/
- enum dlogIDs {rAboutBoxID=128,rNoQuickDrawGXID=129};
-
- enum mbarID {rMenuBar=128};
-
- enum menus {mApple=128,mFile,mEdit,fontMenuID, nestingMenuID};
-
- enum mApplItems {iAbout=1};
- enum mFileItems {iNew=1,iOpen,iClose,iSave,iPageSetup=6,iPrint,iPrintOne,iQuit=10};
- enum mEditItems {iUndo=1,iCut=3,iCopy,iPaste,iClear};
- enum mNestItems { zeroCommand = 1, oneCommand,
- twoCommand, threeCommand,
- fourCommand, fiveCommand,
- sixCommand, sevenCommand,
- eightCommand, nineCommand,
- tenCommand, elevenCommand,
- twelveCommand, thirteenCommand,
- fourteenCommand, fifteenCommand,
- dash1Command, nestCommand,
- unnestCommand };
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| STRUCTS
- |**| ---------------------------------------------------------------------
- \**/
- // This is the structure we use to hold our private data for each window.
- // We store a handle to one of these beasties in each window's refCon field.
-
- typedef struct
- {
- gxJob docJob; // print job for this document.
- gxShape docPage; // page shape description for this document.
- LayoutEditHandle docLEHandle; // page shape description for this document.
- } T_Doc, *TP_Doc, **TH_Doc;
-
-
- typedef struct {
- gxFont fontID;
- gxStyle fontStyle;
- } FontMenuData;
-
-
-
-
- extern FontMenuData *fontMenuData;